home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Merciful 2
/
Merciful - Disc 2.iso
/
software
/
d
/
devioustools25.dms
/
devioustools25.adf
/
utils
/
003.lzx
/
AMountains
/
ModeID.c
< prev
next >
Wrap
C/C++ Source or Header
|
2004-02-13
|
835b
|
32 lines
/************************************************************************/
/* */
/* ULONG ModeID( char * ) */
/* */
/* Returns the display mode identifier of a given monitor:mode name. */
/* E.g. ModeID( "NTSC:HighRes Lace" ) resolves to 0x00019004. */
/* */
/************************************************************************/
#include <graphics/displayinfo.h>
#include <proto/graphics.h>
#include <string.h>
ULONG ModeID( char *name )
{
ULONG id = INVALID_ID;
struct NameInfo ni;
while ( ( id = NextDisplayInfo( id ) ) != INVALID_ID ) {
if ( ! ModeNotAvailable( id ) ) {
if ( GetDisplayInfoData( NULL, (UBYTE *) &ni, sizeof( struct NameInfo ), DTAG_NAME, id ) ) {
if ( ! stricmp( name, ni.Name ) ) {
break;
}
}
}
}
return id;
}